﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WebHoiChoMuaBan.Models;

namespace WebHoiChoMuaBan.Controllers.Helpers
{
    public class RealEStateAttributeHelper : HelperBase
    {
        public RealEstateAttribute getRealEstateAttributeById(int rAttId)
        {
            return (from n in this.dataContext.RealEstateAttributes
                    where n.RAttrId == rAttId
                    select n).First();
        }
        //
        // Insert/Delete Methods
        public void Add(RealEstateAttribute attr)
        {
            this.dataContext.RealEstateAttributes.InsertOnSubmit(attr);
        }

        //
        // Persistence
        public void Save()
        {
            this.dataContext.SubmitChanges();
        }
    }
}